package com.liwen.mywebview;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity implements OnClickListener{
    EditText et;
    StoreWebView wv;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main); 
//        et = (EditText) this.findViewById(R.id.EditText01); 
//        Button btn = (Button) this.findViewById(R.id.Button01);
//        btn.setOnClickListener(this);
//        wv = new StoreWebView(this);
          wv = (StoreWebView)this.findViewById(R.id.WebView01);
    }
    @Override
    public void onStart(){
        super.onStart();
        wv.loadUrl("file:///android_asset/index1.html");
//        wv.loadUrl("http://10.10.75.251/Store-html/search1.html");
//        wv.loadUrl("file:///android_asset/search1.html");
//        wv.loadUrl("https://10.0.2.2:8443");
        
    }
    @Override
    public void onStop(){
        super.onStop();
//        wv.clearHistory();
//        wv.clearView();
    }

    public void onClick(View v) {
        wv.loadUrl("http://10.0.2.2/device/top/search.html");
//        String url = et.getText().toString();
//        String url = "http://10.0.2.2/device/top/search.html";
//        String url = "http://10.10.75.251";
//        Log.i("liwen...........", url);
//        wv.loadUrl(url);
        Log.i("xxx", "............................................................");
//        Uri uri = Uri.parse(url);
//        Intent i = new Intent(Intent.ACTION_VIEW,uri);
//        this.startActivity(i);
    }
}